#coding=utf-8

def get_avgs(con, code):
    
    sql = 'select exdate, avg from everydayprice where code=%s order by exdate'
    
    c = con.cursor()
    c.execute(sql, code)
    r = c.fetchall()
    c.close()

    if not r:return None
    r = [[ i[0].isoformat(), str(i[1]) ] for i in r] 
    return r
    
